import java.util.*;

public class CollectionDemo {
    public static void main(String[] args) {
        Collection c1=new ArrayList();
        Collection c2=new ArrayList();

        c1.add("奔驰");
        c1.add("奥迪");
        c1.add("宝马");
        c1.add("大众");

        c2.addAll(c1);
        System.out.println(c1);
        System.out.println(c2);

        System.out.println("容器1中汽车品牌的数量为："+c1.size());
        System.out.println(c1.contains("奥迪"));

        c1.retainAll(c2);
        System.out.println(c1);

        c2.clear();
        System.out.println(c2);

        System.out.println(c2.isEmpty());
    }
}
